package com.luoruihang.logstatementgenerator.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.luoruihang.logstatementgenerator.application.IGenerateLogStatement;
import com.luoruihang.logstatementgenerator.domain.model.ActionContext;
import com.luoruihang.logstatementgenerator.domain.service.impl.GenerateLogStatementImpl;

public class GenerateAction extends AnAction {
	private IGenerateLogStatement generateLogStatement = new GenerateLogStatementImpl();

	@Override
	public void actionPerformed(AnActionEvent e) {
    DataContext dataContext = e.getDataContext();
		try {
			generateLogStatement.doGenerate(dataContext);
		} catch (Exception exception) {
			exception.printStackTrace();
		}
	}
}
